package cn.webrx;

import java.util.Date;
import java.util.Locale;

public class Switch3 {
    public static void main(String[] args) {


        var n = new String("save"); //byte short int enum String

        Locale.setDefault(Locale.US);
        Date d = new Date();
        int k = d.getDay();
        //switch表达式，有返回值，必须有default->
        String ks = switch (k) {
            case 3 -> "星期三";
            case 1 -> "星期一";
            case 2 -> "星期二";
            case 4 -> "星期四";
            case 5 -> "星期五";
            case 0 -> "星期日";
            default -> "星期六";
        };
        System.out.printf("今日是：%s%n", ks);

        char kks = "日一二三四五六".charAt(k);
        System.out.printf("今日是：星期%s%n", kks);

        System.out.printf("今日是：%tA%n", d);

        //switch语句都支持哪些数据类型？


    }
}
